package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.domain.Notice;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NoticeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Notice record);

    Notice selectByPrimaryKey(Long id);

    List<Notice> selectAll();

    List<Notice> selectPaging(@Param("employee") Employee employee, @Param("qo") QueryObject qo);

    int updateByPrimaryKey(Notice record);

    //单个插入到关系表中
    void saveRelation(@Param("empId") Long empId, @Param("notId") Long notId, @Param("readStatus") boolean readStatus);

    //多个插入到关系表
    void saveRelationByIds(@Param("ids") List<Long> ids, @Param("notId") Long notId);

    //删除多个关系表
    void deleteRelationByNotId(Long notId);

    Boolean selectRead(@Param("empId") Long empId, @Param("notId") Long notId);

    void updateIssueById(@Param("id") Long id, @Param("issue") Boolean issue);

    void updateRelation(@Param("empId") Long empId, @Param("notId") Long notId);
}